// 大事件的路由规则
import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入登录注册组件
const LogBox = () => import('@/project/staggerer/views/LOGBOX/LogBox.vue')
const Reg = () => import('@/project/staggerer/views/Reg/Reg.vue')
const Login = () => import('@/project/staggerer/views/Login/Login.vue')
// 后台主页
const Main = () => import('@/project/staggerer/views/Main/Main.vue')
// 首页
const Home = () => import('@/project/staggerer/views/Home/Home.vue')
// 用户信息组件
const UserInfo = () => import('@/project/staggerer/views/User/UserInfo.vue')
// 更新头像组件
const UserAcater = () => import('@/project/staggerer/views/User/UserAcater.vue')
// 重置密码
const UserPwd = () => import('@/project/staggerer/views/User/UserPwd.vue')
// 文章分类
const ActCate = () =>
  import('@/project/staggerer/views/Menus/article/ArtCater.vue')
// 导入路由组件
const ArtList = () =>
  import('@/project/staggerer/views/Menus/article/ArtList.vue')

Vue.use(VueRouter)

export default [
  {
    path: 'logbox',
    redirect: '/staggerer/logbox/login',
    component: LogBox,
    children: [
      { path: 'reg', component: Reg },
      { path: 'login', component: Login }
    ]
  },
  {
    path: 'main',
    component: Main,
    redirect: '/staggerer/main/home',
    children: [
      // 首页路由
      { path: 'home', component: Home },
      // 用户信息的子路由
      { path: 'user-info', component: UserInfo },
      { path: 'user-pwd', component: UserPwd },
      { path: 'user-avatar', component: UserAcater },
      // 文章路由
      { path: 'art-cate', component: ActCate },
      // 文章列表组件的子路由规则
      { path: 'art-list', component: ArtList }
    ]
  }
]
